<?php
/**
 * Template Name: Games Template
 */
get_header();
global $dktmSetting;
?>

<div class="wrapper xinformation-page archive-info" >
    <div class="bread-search">
        <aside>
            <?php
            //get_dktm_popup_edit('information');
            dktm_breadcrumbs();
            ?>
        </aside>
        <aside class="search">
            <?php //get_template_part('searchform', "information");  ?>
        </aside>
        <div class="clear"></div>
    </div>
    <div id="primary">
        <div class="single-page" style="padding-bottom: 0;">
            <?php
                    $profs = new WP_Query(array('post_type' => 'page',  'post_status'=>'publish','page_id' => @$dktmSetting['games_id']));
                    while ($profs->have_posts()) {
                        $profs->the_post();
                        // echo get_the_ID();
                        ?>
                        <header class="entry-header">
                            <h1 class="entry-title"><?php the_title(); ?></h1>

                        </header><!-- .entry-header -->
                        <div class="description"><?php the_content(); ?></div>
                        <?php }wp_reset_query();
                    ?>
        </div>
        <div id="content" role="main" class="sub-single-page">
            <div id="masonry_wrap" class=" wrapper clearfix navigation-single information-page">
                <?php /*
                $args = array(
                    'post_type' => 'entertainment',
                    'posts_per_page'=>25,
                    'tax_query' => array(
                        array(
                            'taxonomy' => 'entertainment_cat',
                            'field' => 'slug', //can be set to ID
                            'terms' => 'games' //if field is ID you can reference by cat/term number
                        )
                    )
                );
                $custom_query = new WP_Query($args);
                while ($custom_query->have_posts()) : $custom_query->the_post();
                    ?>
                    <?php get_template_part('content', 'entertainment');?>  
<?php endwhile;
echo get_next_posts_link( '<span class="pre direction">', $custom_query->max_num_pages );
echo get_previous_posts_link( '<span class="next direction">' );
wp_reset_query();
// end of the loop. */ ?>
            </div><!-- #content -->

        </div>
    </div><!-- #primary -->
<?php get_sidebar('entertainment'); ?>
    <div class="clear"></div>
</div>
<?php get_footer(); ?>
<script>
    $(document).ready(function() {
        activateMasonry();
        loadMore(1,'ajax-entertainment_games');
    });
</script>